package org.fin.minicat.container;

import org.fin.minicat.request.Request;
import org.fin.minicat.responce.Responce;

public abstract class Servlet {

  public void service(Request request, Responce responce) throws Exception {
    switch (request.getMethod()) {
      case GET:
        doGet(request, responce);
        break;
      case POST:
        doPost(request, responce);
        break;
      default:
        throw new RuntimeException("unkown request method");
    }
  }

  public void doGet(Request request, Responce responce) throws Exception {
  }

  public void doPost(Request request, Responce responce) throws Exception {

  }
}
